package Java练习.面向对象综合练习.抽象类;

import java.util.stream.Stream;

public abstract class animal {
    private String name;
    private int age;
    //创建空参

    public animal() {
    }
    //构造有参
    public animal(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    //定义喝水的行为
    public void drink(){
        System.out.println("喝水");
    }
    public abstract void eat();
}
